﻿using System;
using System.Collections.Generic;
using Autodesk.Revit.DB;
using YJKRevitDimension.ArrowDimension;
using YJKPatternSign.StairsRoomPlanSign.ControlLayer;

namespace YJKPatternSign.StairsRoomPlanSign.ModelLayer
{
	public class PathDimensionBean : IDimensionMake
	{
		public List<XYZ> LstPathPoint
		{
			get
			{
				return this.m_lstPathPoint;
			}
			private set
			{
				this.m_lstPathPoint = value;
			}
		}

		public List<int> LstNEndPointCondition
		{
			get
			{
				return this.m_lstNEndPointCondition;
			}
			private set
			{
				this.m_lstNEndPointCondition = value;
			}
		}

		public PathDimensionBean(List<XYZ> m_lstPathPoint, List<int> m_lstNEndPointCondition)
		{
			this.LstPathPoint = m_lstPathPoint;
			this.LstPathPoint.Reverse();
			this.LstNEndPointCondition = m_lstNEndPointCondition;
		}

		private string GetText(List<int> LstNEndPointCondition)
		{
			string result = "";
			int num = LstNEndPointCondition[1];
			if (num != 1)
			{
				if (num == 2)
				{
					result = "下";
				}
			}
			else
			{
				result = "上";
			}
			return result;
		}

		public bool TryMakeSign(Autodesk.Revit.DB.Document inputDoc, ViewPlan useView)
		{
			string empty = string.Empty;
			Document newDoc = null;
			string text = this.GetText(this.LstNEndPointCondition);
			ArrowDimData data = new ArrowDimData("双侧实心箭头", "仿宋", "在线端", text, "", "3.0", "0.7", "15°", "3", true);
			ArrowDimTempFamily.Draw(SignManger.Uidoc, newDoc, data, this.LstPathPoint, out empty, false, useView);
			return true;
		}

		private List<XYZ> m_lstPathPoint = new List<XYZ>();

		private List<int> m_lstNEndPointCondition = new List<int>();
	}
}
